Skip to content

Conversation

@ericglau
Copy link
Member

@ericglau ericglau commented Apr 2, 2024

  • Use OpenZeppelin Contracts for Cairo v0.11.0.
  • Add ERC1155.
  • Remove redundant not paused assertions for camel case functions.
  • Fix use of ERC20 mixin.
  • Sort imports alphabetically.

@socket-security
Copy link

socket-security bot commented Apr 2, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@types/node@18.19.28 None +3 2.18 MB types
npm/has-bigints@1.0.2 None 0 12.8 kB ljharb
npm/has-tostringtag@1.0.2 None 0 17.6 kB ljharb
npm/highlight.js@11.9.0 None 0 5.29 MB highlightjs_bot
npm/highlightjs-cairo@0.4.0 None 0 10.5 kB ericglau
npm/highlightjs-solidity@2.0.6 None 0 42 kB haltman
npm/icss-utils@5.1.0 None 0 10 kB evilebottnawi
npm/immediate@3.0.6 None 0 14.6 kB cwmma
npm/is-arguments@1.1.1 None 0 28.8 kB ljharb
npm/is-callable@1.2.7 None 0 28.9 kB ljharb
npm/is-generator-function@1.0.10 eval 0 31.9 kB ljharb
npm/is-shared-array-buffer@1.0.3 None 0 18.7 kB ljharb
npm/is-string@1.0.7 None 0 19.1 kB ljharb
npm/is-symbol@1.0.4 None 0 22 kB ljharb
npm/is-typed-array@1.1.13 None 0 23.3 kB ljharb
npm/isarray@2.0.5 None 0 3.43 kB juliangruber
npm/jackspeak@2.3.6 environment 0 253 kB isaacs
npm/jest-worker@26.6.2 environment, shell +1 71.3 kB simenb
npm/jiti@1.21.0 environment, filesystem, unsafe 0 1.91 MB pi0
npm/jszip@3.10.1 Transitive: environment +8 1.76 MB stuk
npm/kleur@4.1.5 None 0 20.3 kB lukeed
npm/lilconfig@3.1.1 filesystem 0 17.7 kB antonk52
npm/livereload-js@3.4.1 environment, eval 0 265 kB smhg
npm/livereload@0.9.3 filesystem, network +1 86.7 kB bphogan
npm/local-access@1.1.0 environment 0 4.96 kB lukeed
npm/magic-string@0.30.8 None 0 449 kB antfu
npm/mdn-data@2.0.30 None 0 602 kB schalkneethling
npm/min-indent@1.0.1 None 0 2.97 kB thejameskyle
npm/minipass@5.0.0 None 0 69.5 kB isaacs
npm/mri@1.2.0 None 0 13.3 kB lukeed
npm/mrmime@2.0.0 None 0 32.7 kB lukeed
npm/mz@2.7.0 filesystem, network, shell +2 24.3 kB jongleberry
npm/normalize-url@6.1.0 None 0 21.2 kB sindresorhus
npm/object-hash@3.0.0 None 0 58.9 kB addaleax
npm/p-queue@6.6.2 None +2 41.4 kB sindresorhus
npm/path-browserify@1.0.1 None 0 54.3 kB goto-bus-stop
npm/path-key@2.0.1 None 0 3.02 kB sindresorhus
npm/path-scurry@1.10.2 filesystem +1 991 kB isaacs
npm/pify@2.3.0 None 0 6.02 kB sindresorhus
npm/pirates@4.0.6 unsafe 0 13.5 kB danez
npm/postcss-calc@9.0.1 None 0 151 kB ludovicofischer
npm/postcss-colormin@6.1.0 None +3 68 kB ludovicofischer
npm/postcss-convert-values@6.1.0 None 0 14 kB ludovicofischer
npm/postcss-discard-comments@6.0.2 None 0 11.6 kB ludovicofischer
npm/postcss-discard-duplicates@6.0.3 None 0 7.04 kB ludovicofischer
npm/postcss-discard-empty@6.0.3 None 0 4.5 kB ludovicofischer
npm/postcss-discard-overridden@6.0.2 None 0 6.58 kB ludovicofischer
npm/postcss-import@15.1.0 Transitive: filesystem +1 35.1 kB ryanzim
npm/postcss-js@4.0.1 None 0 8.45 kB ai
npm/postcss-load-config@4.0.2 environment, unsafe +1 692 kB ai
npm/postcss-load-config@5.0.3 environment 0 21.7 kB ai
npm/postcss-merge-longhand@6.0.5 None +1 93.7 kB ludovicofischer
npm/postcss-merge-rules@6.1.1 None +3 82.9 kB ludovicofischer
npm/postcss-minify-font-values@6.1.0 None 0 18.5 kB ludovicofischer
npm/postcss-minify-gradients@6.0.3 None 0 10.3 kB ludovicofischer
npm/postcss-minify-params@6.1.0 None 0 8.13 kB ludovicofischer
npm/postcss-minify-selectors@6.0.4 None 0 10.1 kB ludovicofischer
npm/postcss-modules-extract-imports@3.0.0 None 0 12.2 kB evilebottnawi
npm/postcss-modules-local-by-default@4.0.4 None 0 22.4 kB evilebottnawi
npm/postcss-modules-scope@3.1.1 None 0 15 kB evilebottnawi
npm/postcss-modules-values@4.0.0 None 0 9.66 kB evilebottnawi
npm/postcss-nested@6.0.1 None 0 13.9 kB ai
npm/postcss-normalize-charset@6.0.2 None 0 4.54 kB ludovicofischer
npm/postcss-normalize-display-values@6.0.2 None 0 6.03 kB ludovicofischer
npm/postcss-normalize-positions@6.0.2 None 0 8.51 kB ludovicofischer
npm/postcss-normalize-repeat-style@6.0.2 None 0 7.26 kB ludovicofischer
npm/postcss-normalize-string@6.0.2 None 0 11.7 kB ludovicofischer
npm/postcss-normalize-timing-functions@6.0.2 None 0 6.5 kB ludovicofischer
npm/postcss-normalize-unicode@6.1.0 None 0 7.32 kB ludovicofischer
npm/postcss-normalize-url@6.0.2 None 0 11.1 kB ludovicofischer
npm/postcss-normalize-whitespace@6.0.2 None 0 6.01 kB ludovicofischer
npm/postcss-ordered-values@6.0.2 None 0 31.5 kB ludovicofischer
npm/postcss-reduce-initial@6.1.0 None +3 76 kB ludovicofischer
npm/postcss-reduce-transforms@6.0.2 None 0 9.19 kB ludovicofischer
npm/postcss-selector-parser@6.0.16 None +1 203 kB evilebottnawi
npm/postcss-svgo@6.0.3 Transitive: environment, filesystem +2 1.32 MB ludovicofischer
npm/postcss-unique-selectors@6.0.4 None 0 4.64 kB ludovicofischer
npm/postcss-value-parser@4.2.0 None 0 27.2 kB evilebottnawi
npm/postcss@8.4.38 environment, filesystem +2 228 kB ai
npm/query-string@7.1.3 None +2 52.5 kB sindresorhus
npm/resolve.exports@2.0.2 None 0 23.9 kB lukeed
npm/resolve@1.22.8 environment, filesystem +2 185 kB ljharb
npm/rimraf@3.0.2 filesystem 0 17.3 kB isaacs
npm/rimraf@5.0.5 environment, filesystem +2 291 kB isaacs
npm/rollup-plugin-livereload@2.0.5 environment, network, shell 0 14.4 kB thgh
npm/rollup-plugin-styles@4.0.0 environment, filesystem Transitive: network +53 4.59 MB anidetrix
npm/rollup-plugin-svelte@7.2.0 filesystem 0 15.2 kB dummdidumm
npm/rollup-plugin-terser@7.0.2 eval Transitive: environment, filesystem, shell +4 2.25 MB trysound
npm/rollup@2.79.1 environment, filesystem, unsafe +1 6.88 MB lukastaegert
npm/rollup@4.13.2 environment, filesystem +1 2.43 MB lukastaegert
npm/sade@1.8.1 None 0 31.5 kB lukeed
npm/sander@0.5.1 filesystem +2 219 kB rich_harris
npm/semiver@1.1.0 None 0 5.44 kB lukeed
npm/sirv-cli@2.0.2 environment, filesystem, network +3 54 kB lukeed
npm/solidity-ast@0.4.56 None 0 238 kB frangio
npm/sorcery@0.11.0 None 0 157 kB rich_harris
npm/source-map-js@1.2.0 None 0 140 kB 7rulnik
npm/string-width@3.1.0 None +2 44.4 kB sindresorhus
npm/strip-ansi@5.2.0 None +1 9.34 kB sindresorhus
npm/strip-indent@3.0.0 None 0 3.31 kB sindresorhus
npm/sucrase@3.35.0 Transitive: environment, filesystem, shell +7 2.49 MB alangpierce
npm/svelte-check@3.6.8 Transitive: environment, filesystem, unsafe +5 8.96 MB svelte-language-tools-deploy
npm/svelte-preprocess@5.1.3 environment, filesystem 0 103 kB kaisermann
npm/svelte@3.59.2 None 0 10.6 MB conduitry
npm/svelte@4.2.12 None +7 3.06 MB svelte-admin
npm/tailwindcss@3.4.3 environment, filesystem +3 5.54 MB adamwathan
npm/throat@4.1.0 None 0 7.91 kB forbeslindesay
npm/tippy.js@6.3.7 environment 0 2.07 MB atomiks
npm/typescript@4.9.5 None 0 66.8 MB typescript-bot
npm/util@0.12.5 environment 0 33.7 kB goto-bus-stop
npm/uuid@9.0.1 None 0 123 kB ctavan
npm/which-typed-array@1.1.15 None +4 92.7 kB ljharb
npm/wsrun@5.2.4 environment, filesystem, shell Transitive: eval, unsafe +24 1.19 MB ivasilov
npm/yaml@1.10.2 environment 0 448 kB eemeli
npm/yargs-parser@13.1.2 environment 0 57.1 kB oss-bot

🚮 Removed packages: npm/@nomicfoundation/hardhat-toolbox@5.0.0

View full report↗︎

@socket-security
Copy link

socket-security bot commented Apr 2, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/svelte-preprocess@5.1.3

View full report↗︎

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

@ericglau
Copy link
Member Author

ericglau commented Apr 2, 2024

@SocketSecurity ignore npm/svelte-preprocess@5.1.3

Copy link
Member

@ericnordelo ericnordelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good! One small thing: I know it's by design to import the components first, but it appears a little unorganized when, for instance, selecting Roles and Upgradeable. Here's the ouput:

    use openzeppelin::token::erc1155::ERC1155Component;
    use openzeppelin::introspection::src5::SRC5Component
    use openzeppelin::access::accesscontrol::AccessControlComponent
    use openzeppelin::upgrades::UpgradeableComponent
    use openzeppelin::access::accesscontrol::DEFAULT_ADMIN_ROLE
    use openzeppelin::upgrades::interface::IUpgradeable;

The cairo formatter alphabetizes the imports on our end. IMO it'd make sense to follow the formatter. It should also help simplify getCategorizedImports in the wizard 🤞 what do you think?

@ericglau
Copy link
Member Author

ericglau commented Apr 3, 2024

@andrew-fleming Thanks for the suggestion! Updated to sort the imports alphabetically.

@ericglau ericglau requested a review from andrew-fleming April 3, 2024 14:27
Copy link
Contributor

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment on lines 264 to 266
assert(self.erc1155.is_approved_for_all(account, caller), ERC1155Component::Errors::UNAUTHORIZED);␊
if account != caller {␊
assert(self.erc1155.is_approved_for_all(account, caller), ERC1155Component::Errors::UNAUTHORIZED);␊
}␊
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ericglau ericglau merged commit 8d9189d into OpenZeppelin:master Apr 3, 2024
@ericglau ericglau deleted the cairo1155 branch April 3, 2024 17:53
@github-actions github-actions bot mentioned this pull request Jun 20, 2025
@github-actions github-actions bot mentioned this pull request Aug 20, 2025
This was referenced Sep 9, 2025
@github-actions github-actions bot mentioned this pull request Sep 16, 2025
@github-actions github-actions bot mentioned this pull request Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants